import serverRequest from "@/utils/server-request.ts";

export function uploadImageService(file:File) {
    const formData = new FormData();
    formData.append("file", file); // 将文件包装在 FormData 中

    return serverRequest({
        url: "/file/image",
        method: "POST",
        data: formData,
        headers: {
            "Content-Type": "multipart/form-data", // 动态设置 Content-Type
        },
    });
}

export function removeFilesService(fileNameList:string[]) {
    return serverRequest({
        url: "/file",
        method: "DELETE",
        data: fileNameList
    });
}